package com.qch.filter;

/**
 * @Author qch
 * @Date 2021/2/20
 */
public class TimeRecordDO implements Comparable<TimeRecordDO> {
    //方法调用时间
    private long startTime;
    //方法结束时间
    private long spendTime;

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getSpendTime() {
        return spendTime;
    }

    public void setSpendTime(long spendTime) {
        this.spendTime = spendTime;
    }

    public TimeRecordDO(long startTime, long spendTime) {
        this.startTime = startTime;
        this.spendTime = spendTime;
    }

    @Override
    public int compareTo(TimeRecordDO o) {
        //使用升序
        if(this.spendTime>o.spendTime){
            return 1;}
        if(this.spendTime<o.spendTime){
            return -1;}
        return 0;
    }
}
